package com.example.shop_2208.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.shop_2208.R
import com.example.shop_2208.adapter.PayAdapter
import com.example.shop_2208.databinding.FragmentPayingBinding
import com.example.shop_2208.db.MyDbUtils
import com.example.shop_2208.mvvm.BaseViewFragment

class PayingFragment : BaseViewFragment<FragmentPayingBinding>() {
    lateinit var payAdapter: PayAdapter
    override fun initData() {

    }

    override fun initView() {
       payAdapter = PayAdapter()
        binding.rvPaying.adapter = payAdapter
        binding.rvPaying.layoutManager = LinearLayoutManager(context)

        val data = MyDbUtils.getDb().getOrderDao().queryStatus(1)
        payAdapter.data.clear()
        payAdapter.data.addAll(data)
        payAdapter.notifyDataSetChanged()
    }

    override fun getLayout(): Int  = R.layout.fragment_paying

}